<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }
        .d1{
            background: #ccc;

            /* 边框border */
            /* border-top: 1px solid red;
            border-right: 2px dashed blue;
            border-bottom: 4px solid green;
            border-left: 8px solid red; */

            border: 2px solid red;

            /* 内边距padding */
            /* padding-left: 20px;
            padding-top: 30px;
            padding-right: 20px;
            padding-bottom: 40px; */

            /* padding: 20px; */
            padding: 20px 10px;

            /* 外边距margin */
            /* margin-bottom: 50px;
            margin-left: 20px;
            margin-top: 30px;
            margin-right: 40px; */
            
            /* margin: 50px; */
            /* margin: 50px 270px; */

            /* 盒子水平居中 */
            margin: 50px auto;
        }
        .d2{
            background: #666;
        }
    </style>
</head>
<body>
    <div class="d1">div1</div>
    <div class="d2">div2</div>
</body>
</html>